package com.ciaojian.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ciaojian.core.model.HairArchive;
import org.apache.ibatis.annotations.*;

/**
 * @author oxiny
 */
public interface HairArchiveMapper extends BaseMapper<HairArchive> {

    /**
     * 根据uid分页
     *
     * @param page 分页插件
     * @param userId /
     * @return /
     */
    @Select("SELECT * FROM d_hair_archive WHERE user_id = #{userId}")
    @Results(
            @Result(column = "id", property = "hairArchiveImgList", many = @Many(select = "com.ciaojian.core.mapper.HairArchiveImgMapper.listByArchiveId"))
    )
    Page<HairArchive> pageByUid(Page<HairArchive> page, @Param("userId") Integer userId);

}
